package com.demo.kafka;

import org.apache.log4j.Logger;

import com.util.LogFormat;

public class App {
    private static final Logger LOGGER = Logger.getLogger(App.class);
    public static void main(String[] args) throws InterruptedException {
//        for (int i = 20; i < 25; i++) {
//            LOGGER.info("This is Message [" + i + "] from log4j producer");
//            Thread.sleep(1000);
//        }
        for (int i = 0; i < 100; i++) {
//            LOGGER.info("Info [" + i + "]");
            LOGGER.info("订单消息发送失败order id=1111110");//订单消息发送失败&order id=?0?taodengwen@diandian-tech.com
            LOGGER.info("13711112222");//订单消息发送失败&order id=?0?taodengwen@diandian-tech.com
            LOGGER.info("哎呀，你在搞什么锤子啊？");//订单消息发送失败&order id=?0?taodengwen@diandian-tech.com
           //Thread.sleep(1000);
            try{
            	System.out.println(1/0);
            }catch(Exception e){
//            	LOGGER.error("error", e);
//            	System.out.println("info："+LogFormat.logFormat(e, 1));
            	LOGGER.error("error："+LogFormat.logFormat(e, 1));
            }
            //Thread.sleep(1000);
        }
//        LOGGER.debug("Debug Message.");
//        LOGGER.info("Info Message.");
//        LOGGER.warn("Warn Message.");
//        LOGGER.error("Error Message.");
//        LOGGER.fatal("Fatal Message.");
    }
}
